-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PMM-5086-12634 Agent model refactor. #3338
Conversation
This reverts commit e72961b.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v3 #3338 +/- ##
==========================================
+ Coverage 43.53% 45.28% +1.74%
==========================================
Files 366 193 -173
Lines 44169 28720 -15449
==========================================
- Hits 19230 13006 -6224
+ Misses 23254 14531 -8723
+ Partials 1685 1183 -502
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
now, now) | ||
assertCheckViolation(t, err, "agents", "node_id_or_service_id_for_non_pmm_agent") | ||
}) | ||
}) | ||
}) | ||
} | ||
|
||
func TestDatabaseMigrations(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed because to have this one working we need two encryption structures. So test is removed and we have only one encryption struct for V3.
var DefaultAgentEncryptionColumnsV3 = []encryption.Table{
{
Name: "agents",
Identifiers: []string{"agent_id"},
Columns: []encryption.Column{
{Name: "username"},
{Name: "password"},
{Name: "agent_password"},
{Name: "aws_options", CustomHandler: EncryptAWSOptionsHandler},
{Name: "azure_options", CustomHandler: EncryptAzureOptionsHandler},
{Name: "mongo_options", CustomHandler: EncryptMongoDBOptionsHandler},
{Name: "mysql_options", CustomHandler: EncryptMySQLOptionsHandler},
{Name: "postgresql_options", CustomHandler: EncryptPostgreSQLOptionsHandler},
},
},
}
// DefaultAgentEncryptionColumns contains all tables and it's columns to be encrypted in PMM Server DB.
var DefaultAgentEncryptionColumns = []encryption.Table{
{
Name: "agents",
Identifiers: []string{"agent_id"},
Columns: []encryption.Column{
{Name: "username"},
{Name: "password"},
{Name: "agent_password"},
{Name: "aws_access_key"},
{Name: "aws_secret_key"},
{Name: "azure_options", CustomHandler: EncryptAzureOptionsHandler},
{Name: "mongo_db_tls_options", CustomHandler: EncryptMongoDBOptionsHandler},
{Name: "mysql_options", CustomHandler: EncryptMySQLOptionsHandler},
{Name: "postgresql_options", CustomHandler: EncryptPostgreSQLOptionsHandler},
},
},
}
`UPDATE agents SET postgresql_options = '{}'::jsonb WHERE postgresql_options IS NULL`, | ||
|
||
`UPDATE agents SET exporter_options = jsonb_set(exporter_options, '{expose_exporter}', to_jsonb(expose_exporter));`, | ||
`UPDATE agents SET exporter_options = jsonb_set(exporter_options, '{push_metrics}', to_jsonb(push_metrics));`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was wondering if we need a where push_metrics is not null
here to avoid getting {"push_metrics": null}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@idoqo I think no, because pushMetrics was bool on top of agent not *bool. So I think there should not be case with nil for push_metrics. But correct me if I am wrong.
PMM-5086
PMM-12634
FB: PMM-5086-12634 Agent model refactor. Percona-Lab/pmm-submodules#3792